package org.example.provider.Controller;

import jakarta.annotation.Resource;
import org.springframework.cloud.stream.function.StreamBridge;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
public class PublishController {
    @Resource
    StreamBridge bridge;
    @RequestMapping("/publish")
    public String publish(String message){
        bridge.send("myChannel-out-0",message);
        return "消息发送成功！"+new Date();
    }
}